package algorithm.ldk.SelectionSort;

import java.util.Random;

/**
 * @作者：ldk
 * @email 2505496685@qq.com
 * @描述：默认描述
 * @创建时间：9:51 2020-12-31
 * @修改时间：9:51 2020-12-31
 * @修改描述：默认描述
 */
public class ArrayGenerator {

    private ArrayGenerator(){}

    public static Integer[] generateOrderedArray(int n){
        Integer[] arr = new Integer[n];
        for (int i = 0; i < n; i++ ){
            arr[i] = i;
        }
        return arr;
    }

    //生成一个长度为 n 的随机数组，每个数组的范围是[0,bound)
    public static Integer[] generateRandomArray(int n, int bound){

        Integer[] arr = new Integer[n];
        Random random = new Random();
        for (int i = 0; i < n; i ++){
            arr[i] = random.nextInt(bound);
        }
        return arr;
    }



}
